package com.ctgu.rabbitmq.rabbitmq.exchange.topicExchange;

import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @ ClassName TopicExchangeConsumer
 * @ Author Alex2
 * @ Date 2025/8/14 15:18
 **/
@Log4j2
@Component
public class TopicExchangeConsumer {

    private final static String TAG = "Alex";

    // 监听 queue_user 队列
    @RabbitListener(queues = TopicExchangeConfig.QUEUE_USER)
    public void receiveFromQueueUser(String message) {
        log.debug("{} : Queue User 收到消息 : {}", TAG, message);
    }

    // 监听 queue_order 队列
    @RabbitListener(queues = TopicExchangeConfig.QUEUE_ORDER)
    public void receiveFromQueueOrder(String message) {
        log.debug("{} : Queue Order 收到消息 : {}", TAG, message);
    }
}
